Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Crop page: increase paddings #5279

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented May 24, 2024

Hi everyone,

The crop page (the page displayed after the photo has been taken) has some visual issues:

  • No top padding
  • "Send image" button taking all the width and aligned on the left
  • "Send image" button with minimal padding

Here are the changes:
Screenshot 2024-05-24 at 05 16 43

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 8.19%. Comparing base (4d9c7fc) to head (f3550e7).
Report is 128 commits behind head on develop.

Files Patch % Lines
packages/smooth_app/lib/pages/crop_page.dart 0.00% 14 Missing ⚠️
...mooth_app/lib/pages/product/edit_image_button.dart 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5279      +/-   ##
==========================================
- Coverage     9.54%   8.19%   -1.36%     
==========================================
  Files          325     356      +31     
  Lines        16411   17923    +1512     
==========================================
- Hits          1567    1468      -99     
- Misses       14844   16455    +1611     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @g123k!
The most important usage of EditImageButton is not with the "Send" buttons but with the 4 "change picture" buttons.
Would you please take a screenshot of an ingredient image page with all 4 buttons? (select existing, take picture, unselect, edit)

() => _controller.rotateLeft(),
Padding(
padding:
const EdgeInsetsDirectional.only(top: SMALL_SPACE),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's a good idea to add a padding there, as it means less space for the image, that is already not that big.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talk about the Crop page here, not the viewer.
Are you sure it's that small?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do talk about the crop page.
The image is quite small on small devices, especially given that our crop tool does not zoom in.
You're right, there is no problem on big screens.

Copy link
Collaborator Author

@g123k g123k May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can only set it for bigger screens.
In the code, is there a threshold to indicate whether it's a small screen?

Padding(
padding: const EdgeInsets.symmetric(
horizontal: VERY_SMALL_SPACE,
vertical: SMALL_SPACE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's a good idea to add a padding there, as it means less space for the image, that is already not that big.

@g123k
Copy link
Collaborator Author

g123k commented May 24, 2024

Hi @g123k! The most important usage of EditImageButton is not with the "Send" buttons but with the 4 "change picture" buttons. Would you please take a screenshot of an ingredient image page with all 4 buttons? (select existing, take picture, unselect, edit)

I think there's a confusion, on the crop page, there's just the Send button at the bottom.

@monsieurtanuki
Copy link
Contributor

I think there's a confusion, on the crop page, there's just the Send button at the bottom.

EditImageButton is used for 5 buttons: once for the "send" button, 4 times for "edit photo" buttons (ProductImageButton).
As the 4 buttons have more space constraints, I would like to check the impact of your changes on EditImageButton.
image

@g123k
Copy link
Collaborator Author

g123k commented Jun 19, 2024

I think there's a confusion, on the crop page, there's just the Send button at the bottom.

EditImageButton is used for 5 buttons: once for the "send" button, 4 times for "edit photo" buttons (ProductImageButton). As the 4 buttons have more space constraints, I would like to check the impact of your changes on EditImageButton. image

You were right, there was a regression.
It's now fixed:

Screenshot 2024-06-19 at 08 37 23 Screenshot 2024-06-19 at 08 37 27

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @g123k!

Thank you for the fix and the screenshots.

Still not convinced by the additional padding as the picture gets smaller. Which is not obvious if you take screenshots on very very large devices ;)

Just browsing the code, I've stumbled into the following enum:

enum DeviceType {
  small,
  smartphone,
  tablet,
  large,
}

If you could add your paddings only for tablet and large, I'd be fine with your PR.

Comment on lines +12 to +20
}) : _centerContent = false;

/// Centered version of the button.
const EditImageButton.center({
required this.iconData,
required this.label,
required this.onPressed,
this.borderWidth,
}) : _centerContent = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't a unique constructor with this.centerContent = false be easier to maintain?

@teolemon teolemon merged commit ebb90b1 into openfoodfacts:develop Jun 20, 2024
6 checks passed
@g123k g123k deleted the croppage_padding branch June 20, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants